/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package android.app;

import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;

/**
 *
 * @author payo
 */
public class Validacion {
    
    public static Boolean validateTF(LinearLayout layout)
    {
        for (int i = 0; i < layout.getChildCount(); i++) {
            View v = layout.getChildAt(i);
            Class c = v.getClass();
            if (c == EditText.class) {
                try{   
                    EditText obj = (EditText)v;
                    Integer in = Integer.parseInt(obj.getText().toString());
                    if(in < 0 || in>255) {
                        return false;
                    }
            }
            catch(Exception e){return false;}
            }
        }
        return true;
    }
}
